$(function(){
    shareWx("");
});
function shareWx(obj){
    // var url = "http://api.live.lajin.com/api/live/lua/v1/weixin/sdkconfig";
    // // data : {'url': encodeURIComponent(window.location.href.split('#')[0])},
    var nowUrl = (window.location.href).split('#')[0];
    var url = 'http://api.teacher114.cn/api/kcx/v1/user/config/jssdk';
    // var url = 'http://api.15joy.com/api/wx/sdkconfig';
    $.ajax({
        type : "get",
        async : false,
        url : url,
        data:{'url':nowUrl},
        timeout : 15000,
        dataType : "json",
        success : function(data) {
            var data = data.content;
            wx.config({
                debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                appId: data.appId, // 必填，公众号的唯一标识
                timestamp:data.timestamp , // 必填，生成签名的时间戳
                nonceStr: data.nonceStr, // 必填，生成签名的随机串
                signature: data.signature,// 必填，签名，见附录1
                jsApiList: [
                        'checkJsApi',
                        'onMenuShareTimeline',
                        'onMenuShareAppMessage',
                        'onMenuShareQQ',
                        'onMenuShareWeibo',
                        'onMenuShareQZone',
                        'hideMenuItems',
                        'showMenuItems',
                        'hideAllNonBaseMenuItem',
                        'showAllNonBaseMenuItem',
                        'translateVoice',
                        'startRecord',
                        'stopRecord',
                        'onVoiceRecordEnd',
                        'playVoice',
                        'onVoicePlayEnd',
                        'pauseVoice',
                        'stopVoice',
                        'uploadVoice',
                        'downloadVoice',
                        'chooseImage',
                        'previewImage',
                        'uploadImage',
                        'downloadImage',
                        'getNetworkType',
                        'openLocation',
                        'getLocation',
                        'hideOptionMenu',
                        'showOptionMenu',
                        'closeWindow',
                        'scanQRCode',
                        'chooseWXPay',
                        'openProductSpecificView',
                        'addCard',
                        'chooseCard',
                        'openCard'
                    ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
            });
        },
        error : function(xOptions, textStatus) {
            // errorCommonDivPayment("系统异常，请稍后再试");
        }
    });
}